home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
thinkref
/
archive
/
THINKPascalUH2.1.sea
/
THINKPas Univ Hdr 2.1
/
Interfaces
/
Connections.p
< prev
next >
Wrap
Text File
|
1995-09-14
|
11KB
|
326 lines
{ Converted with MPW2TPas Tuesday, September 12, 1995 5:40:03 PM }
{}
{ File: Connections.p}
{ }
{ Contains: Communications Toolbox Connection Manager Interfaces.}
{ }
{ Version: Technology: System 7.5}
{ Package: Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
{ }
{ Copyright: © 1984-1995 by Apple Computer, Inc.}
{ All rights reserved.}
{ }
{ Bugs?: If you find a problem with this file, use the Apple Bug Reporter}
{ stack. Include the file and version information (from above)}
{ in the problem description and send to:}
{ Internet: apple.bugs@applelink.apple.com}
{ AppleLink: APPLE.BUGS}
{ }
{}
unit Connections;
interface
{$IFC UNDEFINED __CONNECTIONS__}
{$SETC __CONNECTIONS__ := 1}
uses
ConditionalMacros, Types, Quickdraw, Controls, Windows, Dialogs, AppleTalk, CTBUtilities;
{ $PUSH}
{ $ALIGN MAC68K}
{ $LibExport+}
const
{ current Connection Manager version }
curCMVersion = 2;
{ current Connection Manager Environment Record version }
curConnEnvRecVers = 0;
{ CMErr }
cmGenericError = -1;
cmNoErr = 0;
cmRejected = 1;
cmFailed = 2;
cmTimeOut = 3;
cmNotOpen = 4;
cmNotClosed = 5;
cmNoRequestPending = 6;
cmNotSupported = 7;
cmNoTools = 8;
cmUserCancel = 9;
cmUnknownError = 11;
type
CMErr = OSErr;
const
cmData = $1;
cmCntl = $2;
cmAttn = $4;
cmDataNoTimeout = $10;
cmCntlNoTimeout = $20;
cmAttnNoTimeout = $40;
cmDataClean = $100;
cmCntlClean = $200;
cmAttnClean = $400;
{ Only for CMRecFlags (not CMChannel) in the rest of this enum }
cmNoMenus = $10000;
cmQuiet = $20000;
cmConfigChanged = $40000;
{ CMRecFlags and CMChannel }
{ Low word of CMRecFlags is same as CMChannel }
type
CMRecFlags = LONGINT;
CMChannel = INTEGER;
const
cmStatusOpening = $1;
cmStatusOpen = $2;
cmStatusClosing = $4;
cmStatusDataAvail = $8;
cmStatusCntlAvail = $10;
cmStatusAttnAvail = $20;
cmStatusDRPend = $40; { data read pending }
cmStatusDWPend = $80; { data write pending }
cmStatusCRPend = $100; { cntl read pending }
cmStatusCWPend = $200; { cntl write pending }
cmStatusARPend = $400; { attn read pending }
cmStatusAWPend = $800; { attn write pending }
cmStatusBreakPend = $1000;
cmStatusListenPend = $2000;
cmStatusIncomingCallPresent = $4000;
cmStatusReserved0 = $8000;
type
CMStatFlags = LONGINT;
const
cmDataIn = 0;
cmDataOut = 1;
cmCntlIn = 2;
cmCntlOut = 3;
cmAttnIn = 4;
cmAttnOut = 5;
cmRsrvIn = 6;
cmRsrvOut = 7;
type
CMBufFields = INTEGER;
CMBuffers = array[0..7] of Ptr;
CMBufferSizes = array[0..7] of LONGINT;
const
cmSearchSevenBit = $1;
type
CMSearchFlags = INTEGER;
const
cmFlagsEOM = $1;
type
CMFlags = INTEGER;
ConnEnvironRec = record
version: INTEGER;
baudRate: LONGINT;
dataBits: INTEGER;
channels: CMChannel;
swFlowControl: BOOLEAN;
hwFlowControl: BOOLEAN;
flags: CMFlags;
end;
ConnEnvironRecPtr = ^ConnEnvironRec;
ConnPtr = ^ConnRecord;
ConnHandle = ^ConnPtr;
ConnectionToolDefProcPtr = ProcPtr; { FUNCTION ConnectionToolDef(hConn: ConnHandle; msg: INTEGER; p1: LONGINT; p2: LONGINT; p3: LONGINT): LONGINT; }
ConnectionSearchCallBackProcPtr = ProcPtr; { PROCEDURE ConnectionSearchCallBack(hConn: ConnHandle; matchPtr: Ptr; refNum: LONGINT); }
ConnectionCompletionProcPtr = ProcPtr; { PROCEDURE ConnectionCompletion(hConn: ConnHandle); }
ConnectionChooseIdleProcPtr = ProcPtr; { PROCEDURE ConnectionChooseIdle; }
ConnectionToolDefUPP = UniversalProcPtr;
ConnectionSearchCallBackUPP = UniversalProcPtr;
ConnectionCompletionUPP = UniversalProcPtr;
ConnectionChooseIdleUPP = UniversalProcPtr;
ConnRecord = record
procID: INTEGER;
flags: CMRecFlags;
errCode: CMErr;
refCon: LONGINT;
userData: LONGINT;
defProc: ConnectionToolDefUPP;
config: Ptr;
oldConfig: Ptr;
asyncEOM: LONGINT;
reserved1: LONGINT;
reserved2: LONGINT;
cmPrivate: Ptr;
bufferArray: CMBuffers;
bufSizes: CMBufferSizes;
mluField: LONGINT;
asyncCount: CMBufferSizes;
end;
const
{ CMIOPB constants and structure }
cmIOPBQType = 10;
cmIOPBversion = 0;
type
CMIOPB = record
qLink: QElemPtr;
qType: INTEGER; { cmIOPBQType }
hConn: ConnHandle;
theBuffer: Ptr;
count: LONGINT;
flags: CMFlags;
userCompletion: ConnectionCompletionUPP;
timeout: LONGINT;
errCode: CMErr;
channel: CMChannel;
asyncEOM: LONGINT;
reserved1: LONGINT;
reserved2: INTEGER;
version: INTEGER; { cmIOPBversion }
refCon: LONGINT; { for application }
toolData1: LONGINT; { for tool }
toolData2: LONGINT; { for tool }
end;
CMIOPBPtr = ^CMIOPB;
const
uppConnectionToolDefProcInfo = $0000FEF0; { FUNCTION (4 byte param, 2 byte param, 4 byte param, 4 byte param, 4 byte param): 4 byte result; }
uppConnectionSearchCallBackProcInfo = $00000FC0; { PROCEDURE (4 byte param, 4 byte param, 4 byte param); }
uppConnectionCompletionProcInfo = $000000C0; { PROCEDURE (4 byte param); }
uppConnectionChooseIdleProcInfo = $00000000; { PROCEDURE ; }
function CallConnectionToolDefProc (hConn: ConnHandle; msg: INTEGER; p1: LONGINT; p2: LONGINT; p3: LONGINT; userRoutine: ConnectionToolDefUPP): LONGINT;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
procedure CallConnectionSearchCallBackProc (hConn: ConnHandle; matchPtr: Ptr; refNum: LONGINT; userRoutine: ConnectionSearchCallBackUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
procedure CallConnectionCompletionProc (hConn: ConnHandle; userRoutine: ConnectionCompletionUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
procedure CallConnectionChooseIdleProc (userRoutine: ConnectionChooseIdleUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function NewConnectionToolDefProc (userRoutine: ConnectionToolDefProcPtr): ConnectionToolDefUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewConnectionSearchCallBackProc (userRoutine: ConnectionSearchCallBackProcPtr): ConnectionSearchCallBackUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewConnectionCompletionProc (userRoutine: ConnectionCompletionProcPtr): ConnectionCompletionUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewConnectionChooseIdleProc (userRoutine: ConnectionChooseIdleProcPtr): ConnectionChooseIdleUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function InitCM: CMErr;
function CMGetVersion (hConn: ConnHandle): Handle;
function CMGetCMVersion: INTEGER;
function CMNew (procID: INTEGER; flags: CMRecFlags; var desiredSizes: CMBufferSizes; refCon: LONGINT; userData: LONGINT): ConnHandle;
procedure CMDispose (hConn: ConnHandle);
function CMListen (hConn: ConnHandle; async: BOOLEAN; completor: ConnectionCompletionUPP; timeout: LONGINT): CMErr;
function CMAccept (hConn: ConnHandle; accept: BOOLEAN): CMErr;
function CMOpen (hConn: ConnHandle; async: BOOLEAN; completor: ConnectionCompletionUPP; timeout: LONGINT): CMErr;
function CMClose (hConn: ConnHandle; async: BOOLEAN; completor: ConnectionCompletionUPP; timeout: LONGINT; now: BOOLEAN): CMErr;
function CMAbort (hConn: ConnHandle): CMErr;
function CMStatus (hConn: ConnHandle; var sizes: CMBufferSizes; var flags: CMStatFlags): CMErr;
procedure CMIdle (hConn: ConnHandle);
procedure CMReset (hConn: ConnHandle);
procedure CMBreak (hConn: ConnHandle; duration: LONGINT; async: BOOLEAN; completor: ConnectionCompletionUPP);
function CMRead (hConn: ConnHandle; theBuffer: univ Ptr; var toRead: LONGINT; theChannel: CMChannel; async: BOOLEAN; completor: ConnectionCompletionUPP; timeout: LONGINT; var flags: CMFlags): CMErr;
function CMWrite (hConn: ConnHandle; theBuffer: univ Ptr; var toWrite: LONGINT; theChannel: CMChannel; async: BOOLEAN; completor: ConnectionCompletionUPP; timeout: LONGINT; flags: CMFlags): CMErr;
function CMIOKill (hConn: ConnHandle; which: INTEGER): CMErr;
procedure CMActivate (hConn: ConnHandle; activate: BOOLEAN);
procedure CMResume (hConn: ConnHandle; resume: BOOLEAN);
function CMMenu (hConn: ConnHandle; menuID: INTEGER; item: INTEGER): BOOLEAN;
function CMValidate (hConn: ConnHandle): BOOLEAN;
procedure CMDefault (var theConfig: Ptr; procID: INTEGER; allocate: BOOLEAN);
function CMSetupPreflight (procID: INTEGER; var magicCookie: LONGINT): Handle;
function CMSetupFilter (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; var theEvent: EventRecord; var theItem: INTEGER; var magicCookie: LONGINT): BOOLEAN;
procedure CMSetupSetup (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; var magicCookie: LONGINT);
procedure CMSetupItem (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; var theItem: INTEGER; var magicCookie: LONGINT);
procedure CMSetupXCleanup (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; OKed: BOOLEAN; var magicCookie: LONGINT);
procedure CMSetupPostflight (procID: INTEGER);
function CMGetConfig (hConn: ConnHandle): Ptr;
function CMSetConfig (hConn: ConnHandle; thePtr: univ Ptr): INTEGER;
function CMIntlToEnglish (hConn: ConnHandle; inputPtr: univ Ptr; var outputPtr: Ptr; language: INTEGER): OSErr;
function CMEnglishToIntl (hConn: ConnHandle; inputPtr: univ Ptr; var outputPtr: Ptr; language: INTEGER): OSErr;
function CMAddSearch (hConn: ConnHandle; theString: ConstStr255Param; flags: CMSearchFlags; callBack: ConnectionSearchCallBackUPP): LONGINT;
procedure CMRemoveSearch (hConn: ConnHandle; refnum: LONGINT);
procedure CMClearSearch (hConn: ConnHandle);
function CMGetConnEnvirons (hConn: ConnHandle; var theEnvirons: ConnEnvironRec): CMErr;
function CMChoose (var hConn: ConnHandle; where: Point; idle: ConnectionChooseIdleUPP): INTEGER;
procedure CMEvent (hConn: ConnHandle; {CONST}
var theEvent: EventRecord);
procedure CMGetToolName (procID: INTEGER; var name: Str255);
function CMGetProcID (name: ConstStr255Param): INTEGER;
procedure CMSetRefCon (hConn: ConnHandle; refCon: LONGINT);
function CMGetRefCon (hConn: ConnHandle): LONGINT;
function CMGetUserData (hConn: ConnHandle): LONGINT;
procedure CMSetUserData (hConn: ConnHandle; userData: LONGINT);
procedure CMGetErrorString (hConn: ConnHandle; id: INTEGER; var errMsg: Str255);
function CMNewIOPB (hConn: ConnHandle; var theIOPB: CMIOPBPtr): CMErr;
function CMDisposeIOPB (hConn: ConnHandle; theIOPB: CMIOPBPtr): CMErr;
function CMPBRead (hConn: ConnHandle; theIOPB: CMIOPBPtr; async: BOOLEAN): CMErr;
function CMPBWrite (hConn: ConnHandle; theIOPB: CMIOPBPtr; async: BOOLEAN): CMErr;
function CMPBIOKill (hConn: ConnHandle; theIOPB: CMIOPBPtr): CMErr;
{ $ALIGN RESET}
{ $POP}
{$ENDC}
{__CONNECTIONS__}
implementation
end.